Package-level declarations

Types

Link copied to clipboard

Represents the state of a text input.

Properties

Link copied to clipboard

A modified KeyboardOptions.Default with autoCorrect set to false and keyboardType set to KeyboardType.Password.

Functions

Link copied to clipboard
fun PasswordInput(label: String, value: String, passwordHidden: Boolean, onValueChange: (String) -> Unit, onPasswordHiddenChange: (Boolean) -> Unit, modifier: Modifier = Modifier, placeholderText: String = "", helperText: String = "", state: TextInputState = TextInputState.Enabled, keyboardOptions: KeyboardOptions = PasswordKeyboardOptions, keyboardActions: KeyboardActions = KeyboardActions.Default, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Password input is a sub-variant of text input. It is used to collect private data and will hide the characters as a user enters them. A user can choose to toggle on the character visibility by clicking the view icon on the far right of the input field. When using a password input be sure to provide detailed helper text listing any requirements related to the data format, such as types of characters allowed or date structure.

Link copied to clipboard
fun TextArea(label: String, value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, placeholderText: String = "", helperText: String = "", state: TextInputState = TextInputState.Enabled, counter: Pair<Int, Int>? = null, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, maxLines: Int = Int.MAX_VALUE, minLines: Int = 1, visualTransformation: VisualTransformation = VisualTransformation.None, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Use a text area when the expected user input is more than a few words and could span multiple lines. Text area has several unique functionalities not included in the text input, like the resize handle, word counter and character counter.

Link copied to clipboard
fun TextInput(label: String, value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, placeholderText: String = "", helperText: String = "", state: TextInputState = TextInputState.Enabled, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, visualTransformation: VisualTransformation = VisualTransformation.None, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Text inputs enable users to enter free-form text data. The type of text field used should reflect the length of the content you expect the user to enter. The default text input is for short, one-line content, whereas text area is for longer, multi-line entries.